import { combineReducers } from "redux";
import { createReducer } from "@utils/makeReducerCreator";
import { login, submit } from "./login/reducer";

/**
 *  根据页面进行Reducer的分类
 *  loginReducer
 *  homeReducer
 */
const initialState = {};
const loginReducer = createReducer([], {});
const homeReducer = createReducer([], {});

// 数据统一封装
// function appReducer(state = initialState, action) {
//   return {
//     login: loginReducer(state.login, action),
//     home: homeReducer(state.home, action)
//   };
// }

const appReducer = combineReducer({
  login: loginReducer,
  home: homeReducer
});

export default combineReducers({ submit, login });
